package com.me.screen;

import com.badlogic.gdx.Screen;
import com.me.enums.ScreenEnum;

public class ScreenManager {
	private Screen screen;

	public ScreenManager() {
		
	}

	public Screen getScreen() {
		if (screen == null) {
			//screen = new MenuScreen();
		}
		return screen;
	}

	public Screen createScreen(ScreenEnum scr) {
		switch (scr) {
			case LOADING_SCREEN:
				clearScreen();
				screen = new LoadingScreens();
				return screen;
			case MENU_SCREEN:
				clearScreen();
				screen = new MainMenuScreen();
				return screen;
			case PLAY_SCREEN:
				clearScreen();
				screen = new PlayScreen();
				return screen;
			case SELECT_LEVEL_SCREEN:
				clearScreen();
				//screen = new SelectLevelScreen();
				return screen;
			case WIN_LEVEL_SCREEN:
				clearScreen();
				//screen = new WinLevelScreen();
				return screen;
			case LOSE_LEVEL_SCREEN:
				clearScreen();
				//screen = new LoseLevelScreen();
				return screen;
			}
		//return new MenuScreen();
		return null;
	}

	private void clearScreen() {
		if (screen != null)
			screen.dispose();
	}
}
